package scope;

import java.util.Hashtable;
import java.util.Vector;

import utility.ConvertToLower;


import dbmanager.DBManager;
import dbmanager.GetIdName;

public class Public implements Scope
{
	Vector<Object> scopeVector = new Vector<Object>();
	String PUBLIC="public";
	GetIdName gid;
	DBManager database;
	public Vector<Object> getVector()
	{
		return scopeVector;
	}

	public void processScope() 
	{
		Vector<Object>tempvector = new Vector<Object>();
		tempvector.addAll(scopeVector);
		for(int i=0;i<scopeVector.size();i++)
		{
			Hashtable<Object, Object>table =(Hashtable<Object, Object>) scopeVector.get(i);
			table = ConvertToLower.convertHashKey(table);
			if(table.get("pv").toString().equals(PUBLIC))
				tempvector.remove(i);
		}
		scopeVector.clear();
		scopeVector.addAll(tempvector); 
	}

	public void setDbmanger(DBManager database) 
	{
		this.database = database;
		gid = new GetIdName(database);
		PUBLIC =  gid.getId(PUBLIC);
	}

	public void setVector(Vector<Object> scopeVector) 
	{	
		this.scopeVector =scopeVector;
	}

	public void getParent(String parentobject) 
	{
	
	}

}
